package com.cloudwise.monitoring_system.service.impl;

import com.cloudwise.monitoring_system.dao.OperLogDao;
import com.cloudwise.monitoring_system.entity.OperLog;
import com.cloudwise.monitoring_system.service.OperLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (Operlog)表服务实现类
 *
 * @author makejava
 * @since 2021-06-03 11:25:00
 */
@Service("operlogService")
public class OperLogServiceImpl implements OperLogService {
    @Resource
    private OperLogDao operlogDao;

    /**
     * 新增数据
     *
     * @param operlog 实例对象
     * @return 实例对象
     */
    @Override
    public OperLog insert(OperLog operlog) {
        this.operlogDao.insert(operlog);
        return operlog;
    }

    /**
     * 修改数据
     *
     * @param operlog 实例对象
     * @return 实例对象
     */
    @Override
    public OperLog update(OperLog operlog) {
        this.operlogDao.update(operlog);
        return operlog;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.operlogDao.deleteById(id) > 0;
    }

    /**
     * 通过实体作为筛选条件分页查询
     *
     * @param operlog 实例对象
     * @return 对象列表
     */
    @Override
    public List<OperLog> queryAll(OperLog operlog) {

        return  this.operlogDao.queryAll(operlog);
    }
    /**
     * 按天展示图标显示数据
     * @return
     */
    @Override
    public List<Map>  queryShowChartData(){
        return this.operlogDao.queryShowChartData();
    };
}
